package io.fredia.femicro.gate.server.filter;

import org.springframework.stereotype.Component;

import com.netflix.zuul.ZuulFilter;

import io.fredia.femicro.common.context.BaseContextHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * zuul 过滤器
 * 
 * @author : Fredia
 * @since : 2018年3月12日
 * @version : v1.0.0
 */
@Component
@Slf4j
public class ClearFilter extends ZuulFilter {

    @Override
    public String filterType() {
        return "post";
    }

    @Override
    public int filterOrder() {
        return 1;
    }

    @Override
    public boolean shouldFilter() {
        return true;
    }

    @Override
    public Object run() {
        BaseContextHandler.remove();
        return null;
    }

}
